package com.ztjy.repository.biz.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ztjy.bean.CkWarehouse;
import com.ztjy.repository.biz.CkWarehouseBiz;
import com.ztjy.repository.dao.CkWarehouseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CkWarehouseBizImpl implements CkWarehouseBiz {
    @Autowired
    private CkWarehouseDao cdao;
    @Override
    public PageInfo<CkWarehouse> findAllCk(CkWarehouse ckWarehouse, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        List<CkWarehouse> kc=cdao.findAllCkWarehouse(ckWarehouse);
        PageInfo<CkWarehouse> page=new PageInfo<CkWarehouse>(kc);
        return page;
    }

    @Override
    public boolean addKcWarehouse(CkWarehouse ckWarehouse) {
        return cdao.addCkWarehouse(ckWarehouse);
    }

    @Override
    public CkWarehouse findCkWarehouseById(Integer id) {
        return cdao.findCkWarehouseById(id);
    }

    @Override
    public boolean updateCk(CkWarehouse ckWarehouse) {
        return cdao.updateCk(ckWarehouse);
    }
}
